package com.zzzy.doc.controller.processdoc;

import com.zzzy.common.vo.AjaxResult;
import com.zzzy.common.vo.PageResult;
import com.zzzy.doc.dao.entity.Document;
import com.zzzy.doc.service.processdoc.ProcessDocService;
import com.zzzy.doc.vo.document.process.ProcessDocPageReq;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@Tag(name = "办理公文-已办公文", description = "doc208")
@Validated
@RestController
@RequestMapping("/doc/process")
public class ProcessedDocController {

    @Resource
    private ProcessDocService processDocService;

    @Operation(summary = "分页列表")
    @GetMapping(value = "/processedPage")
    @PreAuthorize("@pvs.hasPermission('doc:process:page')")
    public AjaxResult<PageResult<Document>> processedPage(@Valid @ParameterObject ProcessDocPageReq queryReq) {
        PageResult<Document> docPage = processDocService.getProcessedDocPage(queryReq);
        return AjaxResult.success(docPage);
    }

}
